package com.zr.dao.order;

import com.zr.vo.order.OrderForm;
import java.util.List;

/**
 * 委托订单处理
 * @author huangguilong
 */
public interface OrderFormDao {
    int deleteByPrimaryKey(Integer id);

    int insert(OrderForm record);

    int insertSelective(OrderForm record);

    OrderForm selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OrderForm record);

    int updateByPrimaryKey(OrderForm record);

    //xpj
    List<OrderForm> selectAllByDisPId(Integer DisId);

    /**
     * 条件查询委托订单列表
     * @param orderForm
     * @return List<OrderForm>
     * @author huangguilong
     */
    List<OrderForm> list(OrderForm orderForm);

    /**
     * 获取当前日期最后一个订单编号，用于Redis初始化
     * @param todayNo-当前年月日
     * @return String
     * @author huangguilong
     */
    String getLastOrderId(String todayNo);

    /**
     * 根据客户获取委托订单
     * @param orderForm
     * @return PageInfo<OrderForm>
     * @author wanglu
     */
    List<OrderForm> getByCustomer(OrderForm orderForm);

    int getTodayAddQuantity();

    /**
     * 查询最近一年,每个月的订单数量
     * @return List<OrderForm>
     * @author 张荣颜
     */
    List<OrderForm> getChangeOfOrderQuantityYear();

    /**
     * 查询未完成的订单数量
     * @return int
     * @author 张荣颜
     */
    int getOrderUnfinishedQuantity();

    /**
     * 根据调度单号获取订单信息
     * @param ticketId
     * @return List<OrderForm>
     * @author huangguilong
     */
    List<OrderForm> selectOrderFormListByTicketId(String ticketId);

    int setStatus(OrderForm orderForm);

    int rollBackStatus(String statementId);

    List<OrderForm> selectAllBydistid(String orderTicketId);

    List<OrderForm> selectByStatementId(String statementId);

    List<OrderForm> getCityOrderWeight();

    /**
     * 将带调度的订单改为待提货(不满足条件不更新)
     *
     * @param orderForm1
     * @return
     * @author 陈鹏
     */
    int updateCurrentStatus(OrderForm orderForm1);

    /**
     * 查询未结算货款
     * @return Double
     * @author chengpeng
     */
    Double getAmountNotReceivable();

    /**
     * 查询已经结算货款
     * @return Double
     * @author chengpeng
     */
    Double getAmountReceivable();

    /**
     * 根据订单编号获取订单信息
     * @param orderId
     * @return OrderForm
     * @author huangguilong
     */
    OrderForm selectByOrderId(String orderId);

    List<OrderForm> listByDispatch(Integer id);

    /**
     * 查询近六个月订单
     * @return List<OrderForm>
     * @author 张荣颜
     */
    List<OrderForm> getChangeOfOrderQuantitySixMonths();

    /**
     * 查询近一个月订单
     * @return List<OrderForm>
     * @author 张荣颜
     */
    List<OrderForm> getChangeOfOrderQuantityOneMonth();

    /**
     * 通过调度单id查询订单列表
     *
     * @param dispatchId
     * @return
     * @author 陈鹏
     */
    List<OrderForm> selectAllByDispatchIdWithOrder(Integer dispatchId);
}